#!/usr/bin/env python
# coding=utf-8
# Created on 2014-1-17
#

from libraries import dbase


'''初始化数据库连接池'''
DB_ARGS = dict(host='127.0.0.1',user='root',passwd='',db='test',charset='utf8',port=3306)
dbase.initializeDb(DB_ARGS)
'''获取数据库连接池一个连接 记得关闭连接,或者搞一个装饰墙自动关闭'''
conn = dbase.getOneConn()

'''数据库操作'''
# sql = "delete from t_contactinfo where brandid='%s' and ownuid = %s and invite=1 "%(brandid,uid)
# conn.execute(sql)
# sql = "INSERT INTO t_contactinfo value(,,,)"
# conn.execute(sql)
# sql = "update test set a ='' ..."
# conn.execute(sql)
#查询
sql = "select * from user"
row = conn.query(sql)

for k in row:
    print  k

# print row

